<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Marking')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-marking" data-rule="required" class="form-control" name="row[marking]" type="text" value="{$row.marking|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Serial')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-serial" data-rule="required" class="form-control" name="row[serial]" type="text" value="{$row.serial|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Enclosure_data')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="enclosureDataList" item="vo"}
            <label for="row[enclosure_data]-{$key}"><input id="row[enclosure_data]-{$key}" name="row[enclosure_data]" type="radio" value="{$key}" {in name="key" value="$row.enclosure_data"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group" data-favisible="enclosure_data=0">
        <label class="control-label col-xs-12 col-sm-2">{:__('Enclosure')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-enclosure" class="form-control" name="row[enclosure]" type="text" value="{$row.enclosure|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Software_version')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-software_version" class="form-control" name="row[software_version]" type="text" value="{$row.software_version|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('上次添加的保养时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            {foreach name="row.count" item="vo"}
            <p>保养时间：{$vo.time}
                <span style="margin-left: 10px">备注：{if isset($vo.remark)}{$vo.remark}{/if}</span>
                <span style="margin-left: 10px">开票时间：{if isset($vo.invoicing_time)}{$vo.invoicing_time}{/if}</span>

            </p>


            {/foreach}

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Next_json')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-name="row[next_json]" data-template="testtpl">
                <dd>
                    <ins>时间</ins>
                    <ins>开票时间</ins>
                    <ins>备注</ins>
                </dd>
                <dd>
                    <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                </dd>
                <textarea name="row[next_json]" class="form-control hide" cols="30" rows="5">[{"time":"<?php echo date('Y-m-d',strtotime('+1 day'));?>","invoicing_time":""}]</textarea>
            </dl>
            <!--定义模板-->
            <script type="text/html" id="testtpl">
                <dd class="form-inline">
                    <input type="text" name="row[next_json][<%=index%>][time]" class="form-control  datetimepicker" value="<%=value?value['time']:''%>" placeholder='保养时间'data-date-format="YYYY-MM-DD" >
                    <input type="text" style="width: 110px;" name="row[next_json][<%=index%>][invoicing_time]" class="form-control  datetimepicker" value="<%=value?value['invoicing_time']:''%>" placeholder='开票时间'data-date-format="YYYY-MM-DD" >
                    <input type="text" name="row[next_json][<%=index%>][remark]" class="form-control" value="<%=value?value['remark']:''%>" placeholder='备注'>
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <!--<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>-->
                </dd>
            </script>
           <!-- <dl class="fieldlist" data-name="row[next_json]" data-template="testtpl">
                <dd>
                    <ins>时间</ins>
                    <ins>备注</ins>
                </dd>
                <dd>
                    <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                </dd>
                <textarea name="row[next_json]" class="form-control hide" cols="30" rows="5"></textarea>
                &lt;!&ndash; {php}$next_json=json_decode($row["next_json"],true);{/php}
                 {foreach $next_json as $k=>$v}
                 <dd class="form-inline">
                     <ins><input type="text" data-rule="required" name="row[next_json][{$k}][time]" class="form-control" value="{$v.time}" placeholder=""/></ins>
                     <ins><input type="text" data-rule="required" name="row[next_json][{$k}][remark]" class="form-control" value="" placeholder=""/></ins>
                     <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                 </dd>
                 {/foreach}
                 <dd>
                     <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                 </dd>
                 <textarea name="row[next_json]" class="form-control hide" cols="30" rows="5">{$row.next_json|htmlentities}</textarea>&ndash;&gt;
            </dl>
            &lt;!&ndash;定义模板&ndash;&gt;
            <script type="text/html" id="testtpl">
                <dd class="form-inline">
                    {php}$index="<%=index%>";{/php}
                    <input type="text" name="row[next_json][<%=index%>][time]" class="form-control  datetimepicker" value="<%=value?value['time']:''%>" placeholder='保养时间'data-date-format="YYYY-MM-DD"  data-date-min-date="<?php echo date('Y-m-d',strtotime('+1 day'));?>">
                    <input type="text" name="row[next_json][<%=index%>][remark]" class="form-control" value="<%=value?value['remark']:''%>" placeholder='备注'>
                    {$count}{$index}
                    {php}
                    if( $count > $index){
                        echo "s";
                    }
                    {/php}
                    <span class="btn btn-sm btn-danger btn-remove {if $count>="+<%=index%>+"}hiden{/if}"><i class="fa fa-times">{$count}{$index}<%=index%></i></span>

                    &lt;!&ndash;<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>&ndash;&gt;
                </dd>
            </script>-->
            <!--<script id="testtpl" type="text/html">
                <dd class="form-inline">
                    <ins>
                        <input type="text" name="row[next_json][<%=index%>][time]" class="form-control  datetimepicker" value="<%=value?value['time']:''%>" placeholder='保养时间'data-date-format="YYYY-MM-DD"  data-date-min-date="<?php echo date('Y-m-d',strtotime('+1 day'));?>">
                        </ins>
                    <ins>
                        <input type="text" name="row[next_json][<%=index%>][remark]" class="form-control" value="<%=value?value['remark']:''%>" placeholder='备注'>

                    </ins>
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                </dd>
            </script>-->
        </div>
    </div>
    <div class="form-group"{if !empty($hospital_id)}hidden{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Hospital_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-hospital_id" data-rule="required" data-source="hospital/index" class="form-control selectpage" name="row[hospital_id]" type="text" value="{$row.hospital_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Department_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-department_id" data-rule="required" data-source="department/selectpage2" class="form-control selectpage" name="row[department_id]" type="text" value="{$row.department_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" disabled class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" disabled id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image" data-template="customtpl"></ul>
            <script type="text/html" id="customtpl">
                <li class="col-xs-3">
                    <a href="<%=fullurl%>" data-url="<%=fullurl%>" target="_blank" class="thumbnail"><img src="<%=fullurl%>" class="img-responsive"></a>
                </li>
            </script>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:$row.start_time?datetime($row.start_time):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control " rows="5" name="row[remark]" cols="50">{$row.remark|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
